/*
 *  prefdialog.cpp
 *  Perceel
 *
 *  Created by Nicola Gigante on 13/05/08.
 *  Copyright 2008 Nicola Gigante. All rights reserved.
 *
 */

#include "prefdialog.h"

PrefDialog::PrefDialog(QWidget *parent) : QDialog(parent, Qt::Sheet)
{
	setupUi(this);
	connect(buttonBox, SIGNAL(accepted()), this, SLOT(save()));
	read();
}

void PrefDialog::read()
{
	QSettings s;
	
	languageBox->setCurrentIndex(s.value("settings/language", 0).toInt());
	recentSpin->setValue(s.value("settings/recentsListCount", 10).toInt());
}

void PrefDialog::save()
{
	QSettings s;
	s.setValue("settings/language", languageBox->currentIndex());
	s.setValue("settings/recentsListCount", recentSpin->value());
	
	accept();
}